/*
 * Copyright (c) 2022 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef MSDP_COMMINICATION_COMMON_H
#define MSDP_COMMINICATION_COMMON_H

#include <functional>
#include <memory>
#include <string>
#include <vector>
#include "spatial_common.h"

namespace OHOS {
namespace Msdp {
enum DiscoverEvent : uint32_t {
    DISCOVER_START = 0,
    DISCOVER_DEVICE,
    DISCOVER_END,
    DISCOVER_ERROR,
};

enum GetDeviceEvent : uint32_t {
    GET_SUCCESS = 0,
    GET_FAILED,
};

enum DeviceStateEvent : uint32_t {
    ONLINE = 0,
    OFFLINE,
    READY,
    CHANGED,
};

enum ConnectEvent : uint32_t {
    CONNECTED = 0,
    DISCONNECTED,
    CONNECT_FAILED,
    RECONNECTED,
};


enum SessionOpenEvent : uint32_t {
    OPEN_SUCCESS = 0,
    OPEN_FAILED = 1,
};

enum CommunicationStatus : uint32_t {
    SUCCESS = 0,
    FAIL,
    ACCEPT,
    REJECT,
    NO_CONTENT,
    NOT_SUPPORT,
};

enum SpatialRequestId : uint32_t {
    REQUEST_GET_MAP = 0,
    REQUEST_SYNC_MAP_OFFER,
    REQUEST_SYNC_MAP,
};

enum SpatialResponseId : uint32_t {
    RESPONSE_GET_MAP = 100,
    RESPONSE_SYNC_MAP_OFFER,
    RESPONSE_SYNC_MAP,
};

class SpatialRequest {
public:
    SpatialRequestId requestId;
    int sessionId;
    uint32_t value;
    std::shared_ptr<SpatialMap> map;
};

class SpatialResponse {
public:
    SpatialResponseId responseId;
    int sessionId;
    uint32_t status;
    uint32_t value;
    std::shared_ptr<SpatialMap> map;
};
} // namespace Msdp
} // namespace OHOS

#endif // MSDP_COMMINICATION_COMMON_H